package com.hk.file;

import java.util.ArrayList;
import java.util.List;

import com.hk.ibatis.SqlDaoSuport;
import com.jungbo.file.dto.FileDto;

public class FileManager extends SqlDaoSuport
                                 implements IFileManager{
	public List<FileDto> getFileList(int seq) {
		List<FileDto> list=new ArrayList<FileDto>();
		try {
			list=(List<FileDto>)this.getSqlMapClient().queryForList("getFileList",seq);
		} catch (Exception e) {
			System.out.println(e);
			
		}
		return list;
        	  
		
	}//
	public List<FileDto> getAllFileList() {
		List<FileDto> list=new ArrayList<FileDto>();
		try {
			list=(List<FileDto>)this.getSqlMapClient().queryForList("getAllFileList");
		} catch (Exception e) {
			System.out.println(e);
			
		}
		return list;
        	  
		
	}//
	public ArrayList<FileDto> maxfseq() {
		ArrayList<FileDto> fdto = new ArrayList<FileDto>();
		try{
			 fdto =(ArrayList<FileDto>)this.getSqlMapClient().queryForList("maxfseq");
		} catch (Exception e) {
			System.out.println(e);
		}
		return fdto;
	}
	
	public int addFile(FileDto fDto){
		
		int count=0;
		try {
			this.getSqlMapClient().insert("addFile",fDto);
		} catch (Exception e) {
			System.out.println(e);
			
		}
		return count;
	}//
	public void addmod(){
		
		try {
			this.getSqlMapClient().update("addmod");
		} catch (Exception e) {
			System.out.println(e);
			
		}
		
	}

	public void fseqUpdate(FileDto dto) {
		try{
			this.getSqlMapClient().update("fsequpdate",dto);
		} catch (Exception e) {
			System.out.println(e);
		}
		
	}
	public void delFile(int fseq) {
		try{
			this.getSqlMapClient().delete("filedel",fseq);
		} catch (Exception e) {
			System.out.println(e);
		}
		
	}
	public List<FileDto> getFseq(int seq) {
		List<FileDto> f = null;
		try{
			f=(List<FileDto>)this.getSqlMapClient().queryForList("getfseq",seq);
		} catch (Exception e) {
			System.out.println(e);
		}
		return f;
	}
	public FileDto getFname(int seq) {
		FileDto f = null;
		try{
			f=(FileDto)this.getSqlMapClient().queryForObject("getfname",seq);
		} catch (Exception e) {
			System.out.println(e);
		}
		return f;
	}

	public void pmodbid() {
		try{
			this.getSqlMapClient().update("pmodbid");
		} catch (Exception e) {
			System.out.println(e);
		}
}
}